import Api from '@/service/api/api';
import { request } from '../request';

export function getFinishedBid(params: any) {
  return request<any>({
    url: Api.FinishedBid,
    method: 'get',
    params
  });
}

// 获取标书解析历史列表
export function getAnalysisBidHistory(params: any) {
  return request<any>({
    url: Api.AnalysisHistory,
    method: 'get',
    params
  });
}

// 获取标书查重比对列表
export function getBidCompareList(params: any) {
  return request<any>({
    url: Api.BidCompareList,
    method: 'get',
    params
  });
}

/**
 * 文件夹资源
 *
 * @param params
 */
export function getAllFolder(params: any) {
  return request<any>({
    url: Api.GetAllFolder,
    method: 'get',
    params
  });
}

export function getAllFileList(params: any) {
  return request<any>({
    url: Api.GetAllFileList,
    method: 'get',
    params
  });
}

export function getIndustryList() {
  return request<any>({
    url: Api.GetIndustryList,
    method: 'get'
  });
}

// 新增文件夹
export function insertFolder(data: any) {
  return request<any>({
    url: Api.AddFolder,
    method: 'post',
    data
  });
}

/**
 * 图片上传
 *
 * @param params
 */
export function uploadImageFile(params: any) {
  return request<any>({
    url: Api.UploadPic,
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data: params
  });
}

// 素材库通用图片上传
export function commonImageFile(params: any) {
  return request<any>({
    url: Api.UploadCommonPic,
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data: params
  });
}

export function uploadUserInfoFile(params: any) {
  return request<any>({
    url: Api.UploadUserInfo,
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data: params
  });
}

export function uploadQualificationFile(params: any) {
  return request<any>({
    url: Api.UploadQualification,
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data: params
  });
}

export function uploadOtherFile(params: any) {
  return request<any>({
    url: Api.UploadOther,
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data: params
  });
}

export function uploadDocumentFile(params: any) {
  return request<any>({
    url: Api.UploadDocument,
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data: params
  });
}

/**
 * 删除标书
 *
 * @param params
 */
export function deleteBid(params: any) {
  return request<any>({
    url: Api.DeleteWrite + params,
    method: 'get',
    params
  });
}

/**
 * 删除标书查重记录
 *
 * @param params
 */
export function deleteCompare(params: any) {
  return request<any>({
    url: Api.DeleteBidCompare,
    method: 'get',
    params
  });
}

/**
 * 根据模块id获取剩余次数
 *
 * @param params
 */
export function getUsedCount(params: any) {
  return request<any>({
    url: Api.UsedCount,
    method: 'get',
    params
  });
}

/**
 * 获取租户信息
 *
 * @param params
 */
export function getTenantInfo() {
  return request<any>({
    url: Api.TenantInfo,
    method: 'get'
  });
}

/**
 * 获取创建人下拉列表
 *
 * @param params
 */
export function getSaasUserDrop() {
  return request<any>({
    url: Api.SaasUserDrop,
    method: 'get'
  });
}

/**
 * 获取图片标签
 *
 * @param params
 */
export function getLabelList() {
  return request<any>({
    url: Api.LabelList,
    method: 'get'
  });
}

// 修改图片
export function updateFolderInfo(data: any) {
  return request<any>({
    url: Api.FolderFileEdit,
    method: 'post',
    data
  });
}

/**
 * 删除图片
 *
 * @param params
 */
export function deleteFileInfo(params: any) {
  return request<any>({
    url: Api.FolderFileDelete,
    method: 'get',
    params
  });
}

// 校验图片名称
export function checkFolderName(data: any) {
  return request<any>({
    url: Api.FolderCheckName,
    method: 'post',
    data
  });
}

// 获取案例信息名单
export function getCaseInfoList(params: any) {
  return request<any>({
    url: Api.CaseInfoList,
    method: 'get',
    params
  });
}

// 新增案例信息
export function insertCaseInfo(data: any) {
  return request<any>({
    url: Api.InsertCaseInfo,
    method: 'post',
    data
  });
}

// 编辑案例信息
export function updateCaseInfo(data: any) {
  return request<any>({
    url: Api.UpdateCaseInfo,
    method: 'post',
    data
  });
}

//  删除案例
export function deleteCase(params: any) {
  return request<any>({
    url: Api.DeleteCase,
    method: 'get',
    params
  });
}

// 获取人员信息名单
export function getUserInfoList(params: any) {
  return request<any>({
    url: Api.UserInfoList,
    method: 'get',
    params
  });
}

// 新增人员信息
export function insertUserInfo(data: any) {
  return request<any>({
    url: Api.InsertUserInfo,
    method: 'post',
    data
  });
}

// 编辑人员信息
export function updateUserInfo(data: any) {
  return request<any>({
    url: Api.UpdateUserInfo,
    method: 'post',
    data
  });
}

//  删除图片
export function deleteUser(params: any) {
  return request<any>({
    url: Api.DeleteUser,
    method: 'get',
    params
  });
}

/**
 * 提交反馈
 *
 * @param data
 */
export function SubmitFeedBack(data: any) {
  return request<any>({
    url: Api.SubmitFeedBack,
    method: 'post',
    data
  });
}

// 获取问题类型
export function getProblemType(params: any) {
  return request<any>({
    url: Api.GetProblemType,
    method: 'get',
    params
  });
}

// 新建标书文件夹
export function insertBidFolderAction(params: any) {
  return request<any>({
    url: Api.InsertBidFolder,
    method: 'post',
    data: params
  });
}
